Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement API endpoints for Categories and Products #4

Merged
merged 53 commits into from
Sep 16, 2024

Conversation

nanafox
Copy link
Contributor

@nanafox nanafox commented Sep 16, 2024

This updates add the necessary endpoints, controllers and tests for categories and products.

Currently, the API allows authorized users to perform CRUD operations on the products and categories objects.

The full documentation of the current API behaviour is available here.

This change came about after a number of research. I found that JSON:API
 standard follows best practices and it's something I want to become
 very good at.

 Also, based on the benchmark tests, it is way faster than jbuilder and
 the alternatives I found.
This update makes the `category_id` on the `products` to be optional so
that it doesn't need to be provided when a product does not fit into a
category yet.

It also ensures that when a category is deleted, the products that
depend will have their `category_id` field set to null.

Finally, `available` and `currency` have been introduced to the
`products` to table to help know the availability status of a product
and the currency it uses.
@nanafox nanafox self-assigned this Sep 16, 2024
@nanafox nanafox enabled auto-merge (squash) September 16, 2024 15:21
@nanafox nanafox merged commit c859dc4 into main Sep 16, 2024
3 checks passed
@nanafox nanafox deleted the feature/api-endpoints-products-categories branch September 16, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant